home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 February: Tool Chest / Dev.CD Feb 95 / Dev.CD Feb 95.toast / Tool Chest / Interfaces / Universal Interfaces 2.0a3 / Universal AIncludes / PPCToolbox.a < prev    next >
Encoding:
Text File  |  1994-11-11  |  11.3 KB  |  493 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        PPCToolbox.a
  3. ;
  4. ;    Copyright:    © 1984-1994 by Apple Computer, Inc.
  5. ;                All rights reserved.
  6. ;
  7. ;    Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8. ;
  9. ;    Bugs?:        If you find a problem with this file, send the file and version
  10. ;                information (from above) and the problem description to:
  11. ;
  12. ;                    Internet:    apple.bugs@applelink.apple.com
  13. ;                    AppleLink:    APPLE.BUGS
  14. ;
  15. ;
  16.  
  17.     IF &TYPE('__PPCTOOLBOX__') = 'UNDEFINED' THEN
  18. __PPCTOOLBOX__ SET 1
  19.  
  20.  
  21.     IF &TYPE('__APPLETALK__') = 'UNDEFINED' THEN
  22.     include 'AppleTalk.a'
  23.     ENDIF
  24. ;        include 'Types.a'                                            ;
  25. ;            include 'ConditionalMacros.a'                            ;
  26. ;        include 'OSUtils.a'                                        ;
  27. ;            include 'MixedMode.a'                                    ;
  28. ;            include 'Memory.a'                                        ;
  29.  
  30. ppcServiceRealTime                EQU        1
  31.  
  32. ppcNoLocation                    EQU        0                    ; There is no PPCLocName 
  33. ppcNBPLocation                    EQU        1                    ; Use AppleTalk NBP      
  34. ppcNBPTypeLocation                EQU        2                    ; Used for specifying a location name type during PPCOpen only 
  35.  
  36. ppcByCreatorAndType                EQU        1                    ; Port type is specified as colloquial Mac creator and type 
  37. ppcByString                        EQU        2                    ; Port type is in pascal string format 
  38.  
  39. ; Values returned for request field in PPCInform call 
  40. ; Values returned for requestType field in PPCInform call 
  41. ppcLocalOrigin                    EQU        1                    ; session originated from this machine 
  42. ppcRemoteOrigin                    EQU        2                    ; session originated from remote machine 
  43.  
  44. PPCPortRec                 RECORD    0
  45. nameScript                 ds.w    1                                    ; script of name 
  46. name                     ds.b    33                                ; name of port as seen in browser 
  47. portKindSelector         ds.w    1                                    ; which variant 
  48. VariantLevel0Begin        EQU    *
  49. portTypeStr                 ds.b    33                                ; pascal type string 
  50.                         ORG        VariantLevel0Begin
  51. portCreator                 ds.l    1
  52. portType                 ds.l    1
  53.  
  54. sizeof                     EQU    72
  55.                         ENDR
  56.  
  57. LocationNameRec         RECORD    0
  58. locationKindSelector     ds.w    1                                    ; which variant 
  59. VariantLevel0Begin        EQU    *
  60. nbpEntity                 ds        EntityName                            ; NBP name entity 
  61.                         ORG        VariantLevel0Begin
  62. nbpType                     ds.b    33                                ; just the NBP type string, for PPCOpen 
  63. sizeof                     EQU    104
  64.                         ENDR
  65.  
  66. PortInfoRec             RECORD    0
  67. filler1                     ds.b    1
  68. authRequired             ds.b    1
  69. name                     ds.l    18
  70. sizeof                     EQU    74
  71.                         ENDR
  72.  
  73. PPCOpenPBRec             RECORD    0
  74. qLink                     ds.l    1
  75. csCode                     ds.w    1
  76. intUse                     ds.w    1
  77. intUsePtr                 ds.l    1
  78. ioCompletion             ds.l    1
  79. ioResult                 ds.w    1
  80. Reserved                 ds.l    5
  81. portRefNum                 ds.w    1                                    ; 38 <--   Port Reference 
  82. filler1                     ds.l    1
  83. serviceType                 ds.b    1                                    ; 44 -->    Bit field describing the requested port service 
  84. resFlag                     ds.b    1                                    ; Must be set to 0 
  85. portName                 ds.l    1                                    ; 46 -->   PortName for PPC 
  86. locationName             ds.l    1                                    ; 50 -->   If NBP Registration is required 
  87. networkVisible             ds.b    1                                    ; 54 -->   make this network visible on network 
  88. nbpRegistered             ds.b    1                                    ; 55 <--   The given location name was registered on the network 
  89. sizeof                     EQU    56
  90.                         ENDR
  91.  
  92. PPCInformPBRec             RECORD    0
  93. qLink                     ds.l    1
  94. csCode                     ds.w    1
  95. intUse                     ds.w    1
  96. intUsePtr                 ds.l    1
  97. ioCompletion             ds.l    1
  98. ioResult                 ds.w    1
  99. Reserved                 ds.l    5
  100. portRefNum                 ds.w    1                                    ; 38 -->   Port Identifier 
  101. sessRefNum                 ds.l    1                                    ; 40 <--   Session Reference 
  102. serviceType                 ds.b    1                                    ; 44 <--   Status Flags for type of session, local, remote 
  103. autoAccept                 ds.b    1                                    ; 45 -->   if true session will be accepted automatically 
  104. portName                 ds.l    1                                    ; 46 -->   Buffer for Source PPCPortRec 
  105. locationName             ds.l    1                                    ; 50 -->   Buffer for Source LocationNameRec 
  106. userName                 ds.l    1                                    ; 54 -->   Buffer for Soure user's name trying to link. 
  107. userData                 ds.l    1                                    ; 58 <--   value included in PPCStart's userData 
  108. requestType                 ds.b    1                                    ; 62 <--   Local or Network 
  109. filler                     ds.b    1
  110. sizeof                     EQU    64
  111.                         ENDR
  112.  
  113. PPCStartPBRec             RECORD    0
  114. qLink                     ds.l    1
  115. csCode                     ds.w    1
  116. intUse                     ds.w    1
  117. intUsePtr                 ds.l    1
  118. ioCompletion             ds.l    1
  119. ioResult                 ds.w    1
  120. Reserved                 ds.l    5
  121. portRefNum                 ds.w    1                                    ; 38 -->   Port Identifier 
  122. sessRefNum                 ds.l    1                                    ; 40 <--   Session Reference 
  123. serviceType                 ds.b    1                                    ; 44 <--   Actual service method (realTime) 
  124. resFlag                     ds.b    1                                    ; 45 -->   Must be set to 0  
  125. portName                 ds.l    1                                    ; 46 -->   Destination portName 
  126. locationName             ds.l    1                                    ; 50 -->   NBP or NAS style service location name 
  127. rejectInfo                 ds.l    1                                    ; 54 <--   reason for rejecting the session request 
  128. userData                 ds.l    1                                    ; 58 -->   Copied to destination PPCInform parameter block 
  129. userRefNum                 ds.l    1                                    ; 62 -->   userRefNum (obtained during login process)  
  130. sizeof                     EQU    66
  131.                         ENDR
  132.  
  133. PPCAcceptPBRec             RECORD    0
  134. qLink                     ds.l    1
  135. csCode                     ds.w    1
  136. intUse                     ds.w    1
  137. intUsePtr                 ds.l    1
  138. ioCompletion             ds.l    1
  139. ioResult                 ds.w    1
  140. Reserved                 ds.l    5
  141. filler1                     ds.w    1
  142. sessRefNum                 ds.l    1                                    ; 40 -->   Session Reference 
  143. sizeof                     EQU    44
  144.                         ENDR
  145.  
  146. PPCRejectPBRec             RECORD    0
  147. qLink                     ds.l    1
  148. csCode                     ds.w    1
  149. intUse                     ds.w    1
  150. intUsePtr                 ds.l    1
  151. ioCompletion             ds.l    1
  152. ioResult                 ds.w    1
  153. Reserved                 ds.l    5
  154. filler1                     ds.w    1
  155. sessRefNum                 ds.l    1                                    ; 40 -->   Session Reference 
  156. filler2                     ds.w    1
  157. filler3                     ds.l    1
  158. filler4                     ds.l    1
  159. rejectInfo                 ds.l    1                                    ; 54 -->   reason for rejecting the session request  
  160. sizeof                     EQU    58
  161.                         ENDR
  162.  
  163. PPCWritePBRec             RECORD    0
  164. qLink                     ds.l    1
  165. csCode                     ds.w    1
  166. intUse                     ds.w    1
  167. intUsePtr                 ds.l    1
  168. ioCompletion             ds.l    1
  169. ioResult                 ds.w    1
  170. Reserved                 ds.l    5
  171. filler1                     ds.w    1
  172. sessRefNum                 ds.l    1                                    ; 40 -->   Session Reference 
  173. bufferLength             ds.l    1                                    ; 44 -->   Length of the message buffer 
  174. actualLength             ds.l    1                                    ; 48 <--   Actual Length Written 
  175. bufferPtr                 ds.l    1                                    ; 52 -->   Pointer to message buffer 
  176. more                     ds.b    1                                    ; 56 -->   if more data in this block will be written 
  177. filler2                     ds.b    1
  178. userData                 ds.l    1                                    ; 58 -->   Message block userData Uninterpreted by PPC 
  179. blockCreator             ds.l    1                                    ; 62 -->   Message block creator Uninterpreted by PPC 
  180. blockType                 ds.l    1                                    ; 66 -->   Message block type Uninterpreted by PPC 
  181. sizeof                     EQU    70
  182.                         ENDR
  183.  
  184. PPCReadPBRec             RECORD    0
  185. qLink                     ds.l    1
  186. csCode                     ds.w    1
  187. intUse                     ds.w    1
  188. intUsePtr                 ds.l    1
  189. ioCompletion             ds.l    1
  190. ioResult                 ds.w    1
  191. Reserved                 ds.l    5
  192. filler1                     ds.w    1
  193. sessRefNum                 ds.l    1                                    ; 40 -->   Session Reference 
  194. bufferLength             ds.l    1                                    ; 44 -->   Length of the message buffer 
  195. actualLength             ds.l    1                                    ; 48 <--   Actual length read 
  196. bufferPtr                 ds.l    1                                    ; 52 -->   Pointer to message buffer 
  197. more                     ds.b    1                                    ; 56 <--   if true more data in this block to be read 
  198. filler2                     ds.b    1
  199. userData                 ds.l    1                                    ; 58 <--   Message block userData Uninterpreted by PPC 
  200. blockCreator             ds.l    1                                    ; 62 <--   Message block creator Uninterpreted by PPC 
  201. blockType                 ds.l    1                                    ; 66 <--   Message block type Uninterpreted by PPC 
  202. sizeof                     EQU    70
  203.                         ENDR
  204.  
  205. PPCEndPBRec             RECORD    0
  206. qLink                     ds.l    1
  207. csCode                     ds.w    1
  208. intUse                     ds.w    1
  209. intUsePtr                 ds.l    1
  210. ioCompletion             ds.l    1
  211. ioResult                 ds.w    1
  212. Reserved                 ds.l    5
  213. filler1                     ds.w    1
  214. sessRefNum                 ds.l    1                                    ; 40 -->   Session Reference 
  215. sizeof                     EQU    44
  216.                         ENDR
  217.  
  218. PPCClosePBRec             RECORD    0
  219. qLink                     ds.l    1
  220. csCode                     ds.w    1
  221. intUse                     ds.w    1
  222. intUsePtr                 ds.l    1
  223. ioCompletion             ds.l    1
  224. ioResult                 ds.w    1
  225. Reserved                 ds.l    5
  226. portRefNum                 ds.w    1                                    ; 38 -->   Port Identifier 
  227. sizeof                     EQU    40
  228.                         ENDR
  229.  
  230. IPCListPortsPBRec         RECORD    0
  231. qLink                     ds.l    1
  232. csCode                     ds.w    1
  233. intUse                     ds.w    1
  234. intUsePtr                 ds.l    1
  235. ioCompletion             ds.l    1
  236. ioResult                 ds.w    1
  237. Reserved                 ds.l    5
  238. filler1                     ds.w    1
  239. startIndex                 ds.w    1                                    ; 40 -->   Start Index 
  240. requestCount             ds.w    1                                    ; 42 -->   Number of entries to be returned 
  241. actualCount                 ds.w    1                                    ; 44 <--   Actual Number of entries to be returned 
  242. portName                 ds.l    1                                    ; 46 -->   PortName Match 
  243. locationName             ds.l    1                                    ; 50 -->   NBP or NAS type name to locate the Port Location 
  244. bufferPtr                 ds.l    1                                    ; 54 -->   Pointer to a buffer requestCount*sizeof(PortInfo) bytes big 
  245. sizeof                     EQU    58
  246.                         ENDR
  247.  
  248. PPCParamBlockRec         RECORD    0
  249. VariantLevel0Begin        EQU    *
  250. openParam                 ds        PPCOpenPBRec
  251.                         ORG        VariantLevel0Begin
  252. informParam                 ds        PPCInformPBRec
  253.                         ORG        VariantLevel0Begin
  254. startParam                 ds        PPCStartPBRec
  255.                         ORG        VariantLevel0Begin
  256. acceptParam                 ds        PPCAcceptPBRec
  257.                         ORG        VariantLevel0Begin
  258. rejectParam                 ds        PPCRejectPBRec
  259.                         ORG        VariantLevel0Begin
  260. writeParam                 ds        PPCWritePBRec
  261.                         ORG        VariantLevel0Begin
  262. readParam                 ds        PPCReadPBRec
  263.                         ORG        VariantLevel0Begin
  264. endParam                 ds        PPCEndPBRec
  265.                         ORG        VariantLevel0Begin
  266. closeParam                 ds        PPCClosePBRec
  267.                         ORG        VariantLevel0Begin
  268. listPortsParam             ds        IPCListPortsPBRec
  269. sizeof                     EQU    70
  270.                         ENDR
  271.  
  272.     IF GENERATING68K THEN
  273.         Macro
  274.         _PPCInit
  275.             moveq    #0,d0
  276.             dc.w     $A0DD
  277.         EndM
  278.     ELSE
  279.         IMPORT    PPCInit
  280.     ENDIF
  281.  
  282.     IF GENERATING68K THEN
  283.         Macro
  284.         _PPCOpenSync
  285.             moveq    #1,d0
  286.             dc.w     $A0DD
  287.         EndM
  288.     ELSE
  289.         IMPORT    PPCOpenSync
  290.     ENDIF
  291.  
  292.     IF GENERATING68K THEN
  293.         Macro
  294.         _PPCOpenAsync
  295.             moveq    #1,d0
  296.             dc.w     $A4DD
  297.         EndM
  298.     ELSE
  299.         IMPORT    PPCOpenAsync
  300.     ENDIF
  301.  
  302.     IF GENERATING68K THEN
  303.         Macro
  304.         _PPCInformSync
  305.             moveq    #3,d0
  306.             dc.w     $A0DD
  307.         EndM
  308.     ELSE
  309.         IMPORT    PPCInformSync
  310.     ENDIF
  311.  
  312.     IF GENERATING68K THEN
  313.         Macro
  314.         _PPCInformAsync
  315.             moveq    #3,d0
  316.             dc.w     $A4DD
  317.         EndM
  318.     ELSE
  319.         IMPORT    PPCInformAsync
  320.     ENDIF
  321.  
  322.     IF GENERATING68K THEN
  323.         Macro
  324.         _PPCStartSync
  325.             moveq    #2,d0
  326.             dc.w     $A0DD
  327.         EndM
  328.     ELSE
  329.         IMPORT    PPCStartSync
  330.     ENDIF
  331.  
  332.     IF GENERATING68K THEN
  333.         Macro
  334.         _PPCStartAsync
  335.             moveq    #2,d0
  336.             dc.w     $A4DD
  337.         EndM
  338.     ELSE
  339.         IMPORT    PPCStartAsync
  340.     ENDIF
  341.  
  342.     IF GENERATING68K THEN
  343.         Macro
  344.         _PPCAcceptSync
  345.             moveq    #4,d0
  346.             dc.w     $A0DD
  347.         EndM
  348.     ELSE
  349.         IMPORT    PPCAcceptSync
  350.     ENDIF
  351.  
  352.     IF GENERATING68K THEN
  353.         Macro
  354.         _PPCAcceptAsync
  355.             moveq    #4,d0
  356.             dc.w     $A4DD
  357.         EndM
  358.     ELSE
  359.         IMPORT    PPCAcceptAsync
  360.     ENDIF
  361.  
  362.     IF GENERATING68K THEN
  363.         Macro
  364.         _PPCRejectSync
  365.             moveq    #5,d0
  366.             dc.w     $A0DD
  367.         EndM
  368.     ELSE
  369.         IMPORT    PPCRejectSync
  370.     ENDIF
  371.  
  372.     IF GENERATING68K THEN
  373.         Macro
  374.         _PPCRejectAsync
  375.             moveq    #5,d0
  376.             dc.w     $A4DD
  377.         EndM
  378.     ELSE
  379.         IMPORT    PPCRejectAsync
  380.     ENDIF
  381.  
  382.     IF GENERATING68K THEN
  383.         Macro
  384.         _PPCWriteSync
  385.             moveq    #6,d0
  386.             dc.w     $A0DD
  387.         EndM
  388.     ELSE
  389.         IMPORT    PPCWriteSync
  390.     ENDIF
  391.  
  392.     IF GENERATING68K THEN
  393.         Macro
  394.         _PPCWriteAsync
  395.             moveq    #6,d0
  396.             dc.w     $A4DD
  397.         EndM
  398.     ELSE
  399.         IMPORT    PPCWriteAsync
  400.     ENDIF
  401.  
  402.     IF GENERATING68K THEN
  403.         Macro
  404.         _PPCReadSync
  405.             moveq    #7,d0
  406.             dc.w     $A0DD
  407.         EndM
  408.     ELSE
  409.         IMPORT    PPCReadSync
  410.     ENDIF
  411.  
  412.     IF GENERATING68K THEN
  413.         Macro
  414.         _PPCReadAsync
  415.             moveq    #7,d0
  416.             dc.w     $A4DD
  417.         EndM
  418.     ELSE
  419.         IMPORT    PPCReadAsync
  420.     ENDIF
  421.  
  422.     IF GENERATING68K THEN
  423.         Macro
  424.         _PPCEndSync
  425.             moveq    #8,d0
  426.             dc.w     $A0DD
  427.         EndM
  428.     ELSE
  429.         IMPORT    PPCEndSync
  430.     ENDIF
  431.  
  432.     IF GENERATING68K THEN
  433.         Macro
  434.         _PPCEndAsync
  435.             moveq    #8,d0
  436.             dc.w     $A4DD
  437.         EndM
  438.     ELSE
  439.         IMPORT    PPCEndAsync
  440.     ENDIF
  441.  
  442.     IF GENERATING68K THEN
  443.         Macro
  444.         _PPCCloseSync
  445.             moveq    #9,d0
  446.             dc.w     $A0DD
  447.         EndM
  448.     ELSE
  449.         IMPORT    PPCCloseSync
  450.     ENDIF
  451.  
  452.     IF GENERATING68K THEN
  453.         Macro
  454.         _PPCCloseAsync
  455.             moveq    #9,d0
  456.             dc.w     $A4DD
  457.         EndM
  458.     ELSE
  459.         IMPORT    PPCCloseAsync
  460.     ENDIF
  461.  
  462.     IF GENERATING68K THEN
  463.         Macro
  464.         _IPCListPortsSync
  465.             moveq    #10,d0
  466.             dc.w     $A0DD
  467.         EndM
  468.     ELSE
  469.         IMPORT    IPCListPortsSync
  470.     ENDIF
  471.  
  472.     IF GENERATING68K THEN
  473.         Macro
  474.         _IPCListPortsAsync
  475.             moveq    #10,d0
  476.             dc.w     $A4DD
  477.         EndM
  478.     ELSE
  479.         IMPORT    IPCListPortsAsync
  480.     ENDIF
  481.  
  482.     IF GENERATING68K THEN
  483.         Macro
  484.         _PPCBrowser
  485.             move.w    #$0D00,d0
  486.             dc.w     $A82B
  487.         EndM
  488.     ELSE
  489.         IMPORT    PPCBrowser
  490.     ENDIF
  491.  
  492.     ENDIF ; __PPCTOOLBOX__
  493.